﻿
using System.Windows;
using System.Windows.Controls;

namespace IS_Ever_Green.CustomControls
{
    public partial class BindablePassword : UserControl
    {
        public static readonly DependencyProperty PasswordProperty =
            DependencyProperty.Register("Password", typeof(string), typeof(BindablePassword));

        public string Password
        {
            get { return  (string)GetValue(PasswordProperty); } 
            set { SetValue(PasswordProperty, value); }
        }

        public BindablePassword()
        {
            InitializeComponent();
            txtPassword.PasswordChanged += OnPasswordChange;
        }

        private void OnPasswordChange(object sender, RoutedEventArgs e)
        {
            Password = txtPassword.Password;
        }
    }
}
